Skip to content

fix(genai): VideoGenerationIT/ ImageGenerationIT bucket & Cleanup Fixes - #10334

Draft
Kef131 wants to merge 3 commits into
mainfrom
fix-genai-videogeneration-bucket-cleanup
Draft

fix(genai): VideoGenerationIT/ ImageGenerationIT bucket & Cleanup Fixes#10334
Kef131 wants to merge 3 commits into
mainfrom
fix-genai-videogeneration-bucket-cleanup

Conversation

@Kef131

@Kef131 Kef131 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #
b/549909475

  • Allow overriding the default test bucket using the BUCKET_NAME environment variable (System.getenv().getOrDefault("BUCKET_NAME", "java-docs-samples-testing")).
  • Wrap the @AfterClass cleanup() method in a try-catch block to prevent build failure during teardown if bucket cleanup fails or permissions are restricted.

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.
  • Tests pass: mvn clean verify required
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only

Compliance & Style

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample

Post-Approval Actions

  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Aug 24, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates VideoGenerationIT.java to retrieve the bucket name from an environment variable with a fallback default, and wraps the test cleanup logic in a try-catch block to handle exceptions gracefully. The reviewer suggested sanitizing the BUCKET_NAME environment variable to strip any accidental gs:// prefix, which prevents potential Storage SDK failures and makes the tests more robust.

Comment thread genai/snippets/src/test/java/genai/videogeneration/VideoGenerationIT.java Outdated
@Kef131
Kef131 force-pushed the fix-genai-videogeneration-bucket-cleanup branch from 3c4fa5a to 3921d9c Compare August 24, 2026 22:29
@Kef131 Kef131 changed the title fix(genai): VideoGenerationIT Bucket & Cleanup Fixes fix(genai): VideoGenerationIT/ ImageGenerationIT. Bucket & Cleanup Fixes Aug 24, 2026
@Kef131 Kef131 changed the title fix(genai): VideoGenerationIT/ ImageGenerationIT. Bucket & Cleanup Fixes fix(genai): VideoGenerationIT/ ImageGenerationIT bucket & Cleanup Fixes Aug 24, 2026
@Kef131 Kef131 self-assigned this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant